#include<sys/types.h>

#include"common.h"

typedef struct Battle{
    u_int8_t user_hp;
    char user_name[USER_NAME_LEN+1];
    ACTION user_action;
    u_int8_t enemy_hp;
    char enemy_name[USER_NAME_LEN+1];
    ACTION enemy_action;
    u_int32_t round_number;
}Battle;

extern Battle* create_battle();

extern int action_battle(Battle* ,char name[USER_NAME_LEN+1],ACTION);

extern void finish_action(Battle*);

extern int is_user_lose(Battle* this);

extern int is_enemy_lose(Battle* this);

extern int is_battle_ended(Battle*);

extern Battle* destory_battle(Battle* );